package com.wyw.design.model.learning.structure.proxy;

/**
 * @Title   代理类
 * @Description
 * @Author Mr Wu    yewen.wu.china@gmail.com
 * Update History:
 * Author        Time            Content
 */
public class BuyerProxy implements IBuyer{

    private IBuyer buyer;

    public BuyerProxy(IBuyer buyer) {
        this.buyer = buyer;
    }

    @Override
    public void login(String username, String password) {
        this.buyer.login(username, password);
    }

    @Override
    public void bugTicket() {
        before();
        this.buyer.bugTicket();
        after();
    }

    private void before() {
        System.out.println("准备定时任务，开始刷票");
    }

    private void after() {
        System.out.println("刷票成功，短信通知客户");
    }

}
